package haoyou.csnf.manager.module.pm.dal.mysql.rulesliving;

import java.util.*;

import haoyou.csnf.manager.framework.common.pojo.PageResult;
import haoyou.csnf.manager.framework.mybatis.core.query.LambdaQueryWrapperX;
import haoyou.csnf.manager.framework.mybatis.core.mapper.BaseMapperX;
import haoyou.csnf.manager.module.pm.dal.dataobject.rulesliving.RulesLivingDO;
import org.apache.ibatis.annotations.Mapper;
import haoyou.csnf.manager.module.pm.controller.admin.rulesliving.vo.*;

/**
 * 生活补贴规则 Mapper
 *
 * @author 好有经验源码
 */
@Mapper
public interface RulesLivingMapper extends BaseMapperX<RulesLivingDO> {

    default PageResult<RulesLivingDO> selectPage(RulesLivingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RulesLivingDO>()
                .eqIfPresent(RulesLivingDO::getSeqId, reqVO.getSeqId())
                .eqIfPresent(RulesLivingDO::getPosId, reqVO.getPosId())
                .eqIfPresent(RulesLivingDO::getAmount, reqVO.getAmount())
                .orderByDesc(RulesLivingDO::getId));
    }

}